//
//  CommentModel.m
//  MoneyApp
//
//  Created by leiyifan on 2017/2/20.
//  Copyright © 2017年 leiyifan. All rights reserved.
//

#import "CommentModel.h"

@implementation CommentModel
- (instancetype)initWithDic:(NSDictionary *)dic{
    
    if (self = [super init]) {
//        {
//            "c_id" = 17;
//            comm =             (
//            );
//            comment = "\U54c8\U54c8";
//            time = "2019-05-31 15:32:56";
//            "user_avatar" = "http://haoaihao.oss-cn-beijing.aliyuncs.com/9b6ec3c036d81f8113396613805c7bc8.png";
//            "user_id" = 10;
//            "user_name" = cyx1;
//        }
        self.commentId = dic[@"c_id"];
        self.tabName = dic[@"tabName"];
        self.postUid = dic[@"user_id"];
        self.postNickName = dic[@"user_name"];
        self.postTxImg = dic[@"user_avatar"];
        self.txt1 = dic[@"comment"];
        self.retxt = dic[@"retxt"];
        self.imgUrl = dic[@"imgUrl"];
        self.reId = dic[@"reId"];
        self.postIp = dic[@"postIp"];
        self.dz = dic[@"dz"];
        self.reNum = dic[@"reNum"];
        self.addtime = dic[@"time"];
        self.comm = dic[@"comm"];
        self.reNickName = dic[@"reNickName"];
        self.subject = dic[@"comment"];
        
        
    }
    return self;
    
}
+ (instancetype)commentModelWithDic:(NSDictionary *)dic{
    return [[self alloc]initWithDic:dic];
}
+ (NSArray *)commentModelsList:(NSDictionary *)dic{
    
    NSMutableArray *tmpArray = [NSMutableArray array];
    for (NSDictionary *threeDic in dic) {
        CommentModel *model = [CommentModel commentModelWithDic:threeDic];
        [tmpArray addObject:model];
    }
    return [tmpArray copy];
}
@end
